//Wrapper for EE::Keyboard
#pragma once
#include "stdafx.h"
#undef C
#undef T

namespace EsenthelNet
{
	public enum class KeyboardButtons {
		D0=0x0B, // 0
		D1=0x02, // 1
		D2=0x03, // 2
		D3=0x04, // 3
		D4=0x05, // 4
		D5=0x06, // 5
		D6=0x07, // 6
		D7=0x08, // 7
		D8=0x09, // 8
		D9=0x0A, // 9

		A=0x1E, // A
		B=0x30, // B
		C=0x2E, // C
		D=0x20, // D
		E=0x12, // E
		F=0x21, // F
		G=0x22, // G
		H=0x23, // H
		I=0x17, // I
		J=0x24, // J
		K=0x25, // K
		L=0x26, // L
		M=0x32, // M
		N=0x31, // N
		O=0x18, // O
		P=0x19, // P
		Q=0x10, // Q
		R=0x13, // R
		S=0x1F, // S
		T=0x14, // T
		U=0x16, // U
		V=0x2F, // V
		W=0x11, // W
		X=0x2D, // X
		Y=0x15, // Y
		Z=0x2C, // Z

		F1 =0x3B, // F1
		F2 =0x3C, // F2
		F3 =0x3D, // F3
		F4 =0x3E, // F4
		F5 =0x3F, // F5
		F6 =0x40, // F6
		F7 =0x41, // F7
		F8 =0x42, // F8
		F9 =0x43, // F9
		F10=0x44, // F10
		F11=0x57, // F11
		F12=0x58, // F12

		Escape  =0x01, // escape
		Enter=0x1C, // enter
		Space=0x39, // space
		Backspace =0x0E, // backspace
		Tab  =0x0F, // tab

		LCtrl =0x1D, // left  control
		RCtrl =0x9D, // right control
		LShift=0x2A, // left  shift
		RShift=0x36, // right shift
		LAlt  =0x38, // left  alt
		RAlt  =0xB8, // right alt
		LWin  =0xDB, // left  win
		RWin  =0xDC, // right win
		Menu  =0xDD, // menu key

		Left =0xCB, // left  arrow
		Right=0xCD, // right arrow
		Up   =0xC8, // up    arrow
		Down =0xD0, // down  arrow

		Insert =0xD2, // insert
		Delete =0xD3, // delete
		Home=0xC7, // home
		End =0xCF, // end
		PageUp=0xC9, // page up
		PageDown=0xD1, // page down

		Substract       =0x0C, // subtract      -
		Equal     =0x0D, // equals        =
		LBracket  =0x1A, // left  bracket [
		RBracket  =0x1B, // right bracket ]
		Semicolon =0x27, // semicolon     ;
		Apostrophe=0x28, // apostrophe    '
		Comma     =0x33, // comma         ,
		Dot       =0x34, // dot           .
		Slash     =0x35, // slash         /
		Backslash =0x2B, // backslash     \ 
		Tilde     =0x29, // tilde         `
		Screen    =0xB7, // print  screen
		Caps      =0x3A, // caps   lock
		Num       =0x45, // num    lock
		Scroll    =0x46, // scroll lock

		NDivide  =0xB5, // numpad divide   /
		NMultiply  =0x37, // numpad multiply *
		NSubstract  =0x4A, // numpad subtract -
		NAdd  =0x4E, // numpad add      +
		NEnter=0x9C, // numpad enter
		NDelete  =0x53, // numpad delete
		N0    =0x52, // numpad 0
		N1    =0x4F, // numpad 1
		N2    =0x50, // numpad 2
		N3    =0x51, // numpad 3
		N4    =0x4B, // numpad 4
		N5    =0x4C, // numpad 5
		N6    =0x4D, // numpad 6
		N7    =0x47, // numpad 7
		N8    =0x48, // numpad 8
		N9    =0x49, // numpad 9

		Oem_102=0x56 // <> or \|
	};

	///<summary>Keyboard Input</summary>
	public ref class Keyboard {
	public:
		///<summary>If button 'button' is on</summary>
		bool IsDown(KeyboardButtons button) { return EE::Kb.b((EE::KB_BUTTON)button); }
		///<summary>If button 'button' is pushed</summary>
		bool IsPushed(KeyboardButtons button) { return EE::Kb.bp((EE::KB_BUTTON)button); }
		///<summary>If button 'button' is released</summary>
		bool IsReleased(KeyboardButtons button) { return EE::Kb.br((EE::KB_BUTTON)button); }
		///<summary>If button 'button' is double clicked</summary>
		bool IsDoubleClicked(KeyboardButtons button) { return EE::Kb.bd((EE::KB_BUTTON)button); }

		///<summary>Eat any input from this frame so it will not be processed by the following codes in frame</summary>
		void Eat() { EE::Kb.eat(); }
		///<summary>Eat 'button' input from this frame so it will not be processed by the following codes in frame</summary>
		void Eat(KeyboardButtons button) { EE::Kb.eat((EE::KB_BUTTON)button); }
	};
}